<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Video for Linux Two API Specification"
HREF="book1.htm"><LINK
REL="UP"
TITLE="Function Reference"
HREF="r7624.htm"><LINK
REL="PREVIOUS"
TITLE="ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
VIDIOC_TRY_FMT"
HREF="r10944.htm"><LINK
REL="NEXT"
TITLE="ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT"
HREF="r11217.htm"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Video for Linux Two API Specification: Revision 0.24</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="r10944.htm"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="r11217.htm"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="VIDIOC-G-FREQUENCY"
></A
>ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN11098"
></A
><H2
>Name</H2
>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY&nbsp;--&nbsp;Get or set tuner or modulator radio
frequency</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN11102"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN11103"
></A
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int ioctl</CODE
>(int fd, int request, struct v4l2_frequency
*argp);</CODE
></P
><P
></P
></DIV
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN11113"
></A
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int ioctl</CODE
>(int fd, int request, const struct v4l2_frequency
*argp);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN11123"
></A
><H2
>Arguments</H2
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><CODE
CLASS="PARAMETER"
>fd</CODE
></DT
><DD
><P
>File descriptor returned by <A
HREF="r14090.htm"
><CODE
CLASS="FUNCTION"
>open()</CODE
></A
>.</P
></DD
><DT
><CODE
CLASS="PARAMETER"
>request</CODE
></DT
><DD
><P
>VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY</P
></DD
><DT
><CODE
CLASS="PARAMETER"
>argp</CODE
></DT
><DD
><P
></P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN11143"
></A
><H2
>Description</H2
><P
>To get the current tuner or modulator radio frequency
applications set the <CODE
CLASS="STRUCTFIELD"
>tuner</CODE
> field of a
struct&nbsp;<A
HREF="r11094.htm#V4L2-FREQUENCY"
>v4l2_frequency</A
> to the respective tuner or modulator number (only
input devices have tuners, only output devices have modulators), zero
out the <CODE
CLASS="STRUCTFIELD"
>reserved</CODE
> array and
call the <CODE
CLASS="CONSTANT"
>VIDIOC_G_FREQUENCY</CODE
> ioctl with a pointer
to this structure. The driver stores the current frequency in the
<CODE
CLASS="STRUCTFIELD"
>frequency</CODE
> field.</P
><P
>To change the current tuner or modulator radio frequency
applications initialize the <CODE
CLASS="STRUCTFIELD"
>tuner</CODE
>,
<CODE
CLASS="STRUCTFIELD"
>type</CODE
> and
<CODE
CLASS="STRUCTFIELD"
>frequency</CODE
> fields, and the
<CODE
CLASS="STRUCTFIELD"
>reserved</CODE
> array of a struct&nbsp;<A
HREF="r11094.htm#V4L2-FREQUENCY"
>v4l2_frequency</A
> and
call the <CODE
CLASS="CONSTANT"
>VIDIOC_S_FREQUENCY</CODE
> ioctl with a pointer
to this structure. When the requested frequency is not possible the
driver assumes the closest possible value. However
<CODE
CLASS="CONSTANT"
>VIDIOC_S_FREQUENCY</CODE
> is a write-only ioctl, it does
not return the actual new frequency.</P
><DIV
CLASS="TABLE"
><A
NAME="V4L2-FREQUENCY"
></A
><P
><B
>Table 1. struct <CODE
CLASS="STRUCTNAME"
>v4l2_frequency</CODE
></B
></P
><TABLE
BORDER="0"
FRAME="void"
WIDTH="100%"
CLASS="CALSTABLE"
><COL
WIDTH="25%"
TITLE="C1"><COL
WIDTH="25%"
TITLE="C2"><COL
WIDTH="50%"
TITLE="C3"><TBODY
VALIGN="TOP"
><TR
><TD
>__u32</TD
><TD
><CODE
CLASS="STRUCTFIELD"
>tuner</CODE
></TD
><TD
>The tuner or modulator index number. This is the
same value as in the struct&nbsp;<A
HREF="r8936.htm#V4L2-INPUT"
>v4l2_input</A
> <CODE
CLASS="STRUCTFIELD"
>tuner</CODE
>
field and the struct&nbsp;<A
HREF="r12342.htm#V4L2-TUNER"
>v4l2_tuner</A
> <CODE
CLASS="STRUCTFIELD"
>index</CODE
> field, or
the struct&nbsp;<A
HREF="r9149.htm#V4L2-OUTPUT"
>v4l2_output</A
> <CODE
CLASS="STRUCTFIELD"
>modulator</CODE
> field and the
struct&nbsp;<A
HREF="r11430.htm#V4L2-MODULATOR"
>v4l2_modulator</A
> <CODE
CLASS="STRUCTFIELD"
>index</CODE
> field.</TD
></TR
><TR
><TD
>enum&nbsp;<A
HREF="r12342.htm#V4L2-TUNER-TYPE"
>v4l2_tuner_type</A
></TD
><TD
><CODE
CLASS="STRUCTFIELD"
>type</CODE
></TD
><TD
>The tuner type. This is the same value as in the
struct&nbsp;<A
HREF="r12342.htm#V4L2-TUNER"
>v4l2_tuner</A
> <CODE
CLASS="STRUCTFIELD"
>type</CODE
> field. The field is not
applicable to modulators, i.&nbsp;e. ignored by drivers.</TD
></TR
><TR
><TD
>__u32</TD
><TD
><CODE
CLASS="STRUCTFIELD"
>frequency</CODE
></TD
><TD
>Tuning frequency in units of 62.5 kHz, or if the
struct&nbsp;<A
HREF="r12342.htm#V4L2-TUNER"
>v4l2_tuner</A
> or struct&nbsp;<A
HREF="r11430.htm#V4L2-MODULATOR"
>v4l2_modulator</A
> <CODE
CLASS="STRUCTFIELD"
>capabilities</CODE
> flag
<CODE
CLASS="CONSTANT"
>V4L2_TUNER_CAP_LOW</CODE
> is set, in units of 62.5
Hz.</TD
></TR
><TR
><TD
>__u32</TD
><TD
><CODE
CLASS="STRUCTFIELD"
>reserved</CODE
>[8];</TD
><TD
>Reserved for future extensions. Drivers and
            applications must set the array to zero.</TD
></TR
></TBODY
></TABLE
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN11203"
></A
><H2
>Return Value</H2
><P
>On success <SPAN
CLASS="RETURNVALUE"
>0</SPAN
> is returned, on error <SPAN
CLASS="RETURNVALUE"
>-1</SPAN
> and the <CODE
CLASS="VARNAME"
>errno</CODE
> variable is set appropriately:</P
><P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
><SPAN
CLASS="ERRORCODE"
>EINVAL</SPAN
></DT
><DD
><P
>The <CODE
CLASS="STRUCTFIELD"
>tuner</CODE
> index is out of
bounds or the value in the <CODE
CLASS="STRUCTFIELD"
>type</CODE
> field is
wrong.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="r10944.htm"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.htm"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="r11217.htm"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ioctl VIDIOC_G_FMT, VIDIOC_S_FMT,
VIDIOC_TRY_FMT</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="r7624.htm"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
